<template>
	<view>
		<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000">
			<swiper-item v-for="(item,index) in swiperList"  :key="index">
				<view class="swiper-item">
					<image :src="item.coverImgUrl" style="width: 100%;"></image>
				</view>
			</swiper-item>
		</swiper>
		<u-button type="primary" @click="goStorage">主要按钮</u-button>
		<u-button type="success">成功按钮</u-button>
		<u-button type="info">信息按钮</u-button>
		<u-button type="warning">警告按钮</u-button>
		<u-button type="error" @click="getStorage">危险按钮</u-button>
	</view>
</template>

<script>
	import {post} from "../../utils/http.js"
	export default {
		data() {
			return {
				swiperList:""//轮播图数据
			}
		},
		onLoad() {

		},
		methods: {
			goStorage(){
				uni.setStorageSync("key","123456")
			},
			getStorage(){
				console.log(uni.getStorageSync("key"))
			}
		},
		created(){
			post("/api/cms/article/open/banner/list",{pageNum:1,pageSize:10}).then(res=>{
				console.log(res)
				this.swiperList=res.data.rows
			})
		}
	}
</script>

<style>
.img {
	width: 100%;
	height: 100%;
}
</style>
